Timer Class Reference

Timer is a class that allows you to receive triggers at regular intervals. More...

#include <timer.h>

Inheritance diagram for Timer:
Inheritance graph
[legend]

Public Member Functions

virtual void stop ()=0
 Stop the timer.

Static Public Member Functions

static Timercreate (ITimerCallback *callback, uint32 intervalMilliseconds)
 Create a timer with a given interval.

Detailed Description

Timer is a class that allows you to receive triggers at regular intervals.

Note: The timer class is an abstract base class with (hidden) platform specific subclasses.

Usage:

   class TimerReceiver : public FObject, public ITimerCallback
   {
      ...
      virtual void onTimer (Timer* timer)
      {
         // do stuff
      }
      ...
   };

   TimerReceiver* receiver =  new TimerReceiver ();
   Timer* myTimer = Timer::create (receiver, 100); // interval: every 100ms
   
   ...
   ...

   if (myTimer)
      myTimer->release ();
   if (receiver)
      receiver->release ();
See also:
ITimerCallback

Member Function Documentation

static Timer* create ( ITimerCallback callback,
uint32  intervalMilliseconds 
) [static]

Create a timer with a given interval.

Parameters:
callback The receiver of the timer calls.
intervalMilliseconds The timer interval in milliseconds.
Returns:
The created timer if any, callers owns the timer. The timer starts immediately.
virtual void stop (  )  [pure virtual]

Stop the timer.

 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines
Empty

Copyright ©2013 Steinberg Media Technologies GmbH. All Rights Reserved.